import Vue from 'vue'
import VueRouter from 'vue-router'
import PageOne from "@/views/PageOne";
import PageTwo from "@/views/PageTwo";
import PageThree from "@/views/PageThree";
import PageFour from "@/views/PageFour";
import Index from "@/views/index";
import PageFive from "@/views/PageFive";
import PageSix from "@/views/PageSix";
import PageSeven from "@/views/PageSeven";
import ProductUpdate from "@/views/ProductUpdate";
import ItemUpdate from "@/views/ItemUpdate";
import AccountUpdate from "@/views/AccountUpdate";
import PasswordUpdate from "@/views/PasswordUpdate";
import OrderUpdate from "@/views/OrderUpdate";
import PageEight from "@/views/PageEight";
import PageNine from "@/views/PageNine";
import CategoryUpdate from "@/views/CategoryUpdate";
import productUpload from "@/views/productUpload";
import categoryUpload from "@/views/categoryUpload";

Vue.use(VueRouter)
const routes = [
  {
    path:"/",
    name:"PetStore",
    component:Index,
    redirect:"/pageEight",

    children:[
      {
        path:"/pageEight",
        name:"查询Category",
        component:PageEight,
        showOn:"ok"
      },
      {
        path:"/pageNine",
        name:"添加Category",
        component:PageNine,
        showOn:"ok"
      },
      {
        path:"/categoryUpload",
        name:"Category图片上传",
        component:categoryUpload,
        showOn:"ok"

      },
      {
        path:"/pageOne",
        name:"查询Product",
        component:PageOne,
        showOn:"ok"
      },
      {
        path:"/pageTwo",
        name:"添加Product",
        component:PageTwo,
        showOn:"ok"
      },
      {
        path:"/productUpload",
        name:"Product图片上传",
        component:productUpload,
        showOn:"ok"

      },
      {
        path:"/pageThree",
        name:"查询Item",
        component:PageThree,
        showOn:"ok"
      },
      {
        path:"/pageFour",
        name:"添加Item",
        component:PageFour,
        showOn:"ok"

      },
      {
        path:"/pageSeven",
        name:"查询Order",
        component:PageSeven,
        showOn:"ok"

      },
      {
        path:"/pageFive",
        name:"查询Account",
        component:PageFive,
        showOn:"ok"

      },

      {
        path:"/pageSix",
        name:"修改Password",
        component:PageSix,
        showOn:"ok"

      },
      {
        path:"/productupdate",
        component:ProductUpdate,
        showOn:"no"
      },
      {
        path:"/itemupdate",
        component:ItemUpdate,
        showOn:"no"

      },
      {
        path:"/accountupdate",
        component:AccountUpdate,
        showOn:"no"

      },
      {
        path:"/passwordupdate",
        component:PasswordUpdate,
        showOn:"no"

      },
      {
        path:"/orderupdate",
        component:OrderUpdate,
        showOn:"no"

      },
      {
        path:"/categoryupdate",
        component:CategoryUpdate,
        showOn:"no"

      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
